<div class="view-body">
    <div class="view-inner">
        <div class="view-cont system-admin-cont system-corp">
            <header class="view-cont-hd clearfix">
                <!--页面标题-->
                <a ui-sref="corp" class="btn btn-default btn-xs btn-back"><i class="fa fa-reply"></i>返回上一级</a>
                <!--面包屑-->
                <ol class="breadcrumb">
                    <li>
                        <a ui-sref="corp">组织管理</a>
                    </li>
                    <li ng-repeat="i in ::vm.breadcrumb track by $index">
                        <span>{{i}}</span>
                    </li>
                </ol>
            </header>
            <section class="view-cont-bd">
                <div class="row-pane">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <ui-tabset active-id="vm.activeId">
                                <ui-tab tab-id="info">
                                    <ui-tab-heading>组织信息</ui-tab-heading>
                                    <div ng-if="!vm.isCorpLoad" class="text-center empty">
                                        <span>
                                            <i class="fa fa-spin fa-spinner"></i>
                                            数据加载中...
                                        </span>
                                    </div>
                                    <div ng-if="vm.isCorpLoad">
                                        <div ng-if="!vm.isEdit" class="corp-info">
                                            <div class="clearfix">
                                                <ul class="list-info">
                                                    <li class="list-item">
                                                        <span class="name">机构编码</span>
                                                        <span class="text">{{vm.data.orgCode}}</span>
                                                    </li>
                                                    <li class="list-item">
                                                        <span class="name">机构名称</span>
                                                        <span class="text">{{vm.data.orgName}}</span>
                                                    </li>
                                                    <li class="list-item">
                                                        <span class="name">创建时间</span>
                                                        <span class="text">{{::vm.data.createDate | date:'yyyy-MM-dd' }}</span>
                                                    </li>
                                                </ul>
                                                <ul class="list-info">
                                                    <li class="list-item">
                                                        <span class="name">机构类型</span>
                                                        <span class="text">{{vm.data.orgType}}</span>
                                                    </li>
                                                    <li class="list-item">
                                                        <span class="name">状态</span>
                                                        <span class="text">{{vm.status[vm.data.statusCd]}}</span>
                                                    </li>
                                                    <li class="list-item">
                                                        <span class="name">更新时间</span>
                                                        <span class="text">{{vm.data.updateDate | date:'yyyy-MM-dd'}}</span>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="handle-bar margin-top-20">
                                                <button type="button" class="btn btn-primary btn-xl" ng-click="vm.openCorpEdit()">编辑</button>
                                            </div>
                                        </div>
                                        <div ng-if="vm.isEdit" class="corp-info-edit">
                                            <form name="corpForm" class="form" novalidate>
                                                <div class="row form-group height-60">
                                                    <div class="col-sm-7">
                                                        <label>机构编码<span class="require"></span></label>
                                                        <input type="text" name="orgCode" class="form-control" ng-class="{'error': corpForm.orgCode.$invalid && !corpForm.orgCode.$pristine}" ng-blur="vm.checkValid(corpForm.orgCode)" ng-model="vm.data.orgCode" placeholder="机构编码" required>
                                                    </div>
                                                    <span class="error" ng-show="corpForm.orgCode.$invalid && !corpForm.orgCode.$pristine">机构编码不能为空</span>
                                                </div>
                                                <div class="row form-group height-60">
                                                    <div class="col-sm-7">
                                                        <label>机构名称<span class="require"></span></label>
                                                        <input type="text" name="orgName" class="form-control" ng-class="{'error': corpForm.orgName.$invalid && !corpForm.orgName.$pristine}" ng-blur="vm.checkValid(corpForm.orgName)" ng-model="vm.data.orgName" placeholder="机构名称" required>
                                                    </div>
                                                    <span class="error" ng-show="corpForm.orgName.$invalid && !corpForm.orgName.$pristine">机构名称不能为空</span>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-sm-7">
                                                        <label>状态</label>
                                                        <input type="text" class="form-control" value="{{vm.status[vm.data.statusCd]}}" disabled placeholder="状态">
                                                    </div>
                                                </div>
                                                <div class="from-group handle-bar">
                                                    <button type="button" class="btn btn-primary btn-xl" ng-disabled="corpForm.$invalid || vm.same" ng-click="vm.saveCorp()"><span ng-show="vm.submitting"><i class="fa fa-spinner fa-spin"></i></span>保存</button>
                                                    <button type="button" class="btn btn-default btn-xl" ng-click="vm.saveCorp('cancel')">取消</button>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </ui-tab>
                                <ui-tab tab-id="post" select="vm.load('post')">
                                    <ui-tab-heading>岗位管理</ui-tab-heading>
                                    <div class="handle-bar clearfix">
                                        <div class="btn-group">
                                            <button type="button" ng-disabled="!vm.isPostLoad" ng-click="vm.openCreate('post')" class="btn btn-default"><i class="fa fa-plus"></i>新建岗位</button>
                                            <button type="button" ng-disabled="!vm.isPostLoad || !vm.postList.length" ng-click="vm.makeAuth('post')" class="btn btn-default"><i class="fa fa-tasks"></i>指定权限</button>
                                            <button type="button" ng-disabled="!vm.isPostLoad || !vm.postList.length" ng-click="vm.openAppoint('role', 'post')" class="btn btn-default"><i class="fa fa-flag"></i>指定角色</button>
                                        </div>
                                        <div class="form-group form-inline pull-right">
                                            <select class="form-control" style="width: 100px" ng-change="vm.changePost()" ng-model="vm.postSelect" ng-options="k as v for (k, v) in vm.postClass"></select>
                                            <div class="input-group input-select-group">
                                                <span class="pull-left margin-top-5 margin-left-5" ng-if="vm.postSearching"><i class="fa fa-spin fa-spinner"></i></span>
                                                <select class="form-control" ng-change="vm.changeType('post')" ng-model="vm.search.post.k" ng-options="k as v for (k, v) in vm.postType">
                                                </select>
                                                <input type="text" class="form-control" ng-model="vm.search.post.q" ng-keyup="vm.makeSearch('post',$event)" placeholder="{{vm.search.post.txt}}">
                                                <button class="btn btn-default btn-xl" ng-click="vm.makeSearch('post')"><i class="fa fa-search"></i>搜索</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="table-wrap margin-top-20">
                                        <table class="table">
                                            <thead>
                                            <tr>
                                                <th style="width: 5%">#</th>
                                                <th style="width: 10%">岗位编码</th>
                                                <th style="width: 20%">岗位名称</th>
                                                <th style="width: 20%">岗位描述</th>
                                                <th style="width: 10%">岗位状态</th>
                                                <th style="width: 20%">创建时间</th>
                                                <th style="width: 25%">操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr class="empty" ng-if="!vm.isPostLoad">
                                                <td colspan="7">
                                                    <div class="text-center">
                                                        <span>
                                                            <i class="fa fa-spin fa-spinner"></i>
                                                            数据加载中...
                                                        </span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr class="empty" ng-if="!vm.postList.length && vm.isPostLoad">
                                                <td colspan="7" class="text-center empty">
                                                    <div class="hint">
                                                        <span><i class="fa fa-exclamation-circle"></i>暂无更多数据</span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr ng-repeat="item in vm.postList track by $index">
                                                <td><input type="radio" ng-click="vm.toggleCheck('post',item)" name="postItem"></td>
                                                <td>{{item.sysPostCode}}</td>
                                                <td>{{item.sysPostName}}</td>
                                                <td>{{item.sysPostDesc}}</td>
                                                <td><span class="label label-warning" ng-if="item.statusCd == 'S0X'">{{vm.status[item.statusCd]}}</span><span class="label label-success">{{vm.status[item.statusCd]}}</span></td>
                                                <td>{{item.createDate | date:"yyyy-MM-dd"}}</td>
                                                <td>
                                                    <div class="btn-action" ng-hide="item.confirm">
                                                        <button ng-click="vm.openView('post', item)" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i>编辑</button>
                                                        <button type="button" class="btn btn-danger btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-trash"></i>删除</button>
                                                    </div>
                                                    <div class="btn-action" ng-hide="!item.confirm">
                                                        <button class="btn btn-default btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-times"></i>取消</button>
                                                        <button class="btn btn-primary btn-xs" ng-click="vm.del('post',item.id)"><i class="fa fa-check"></i>确定</button>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                     <div class="row-pane">
                                        <div class="pagination-group" ng-if="vm.hasPager">
                                            <ui-pagination ng-show="vm.postList" items-per-page="vm.page.post.perPage" total-items="vm.page.post.totalItems" ng-model="vm.page.post.currentPage" max-size="3" jump-input="true" ng-change="vm.changePage('post',vm.page.post.currentPage)"></ui-pagination>
                                        </div>
                                    </div>
                                </ui-tab>
                                <ui-tab tab-id="staff" select="vm.load('staff')">
                                    <ui-tab-heading>员工管理</ui-tab-heading>
                                    <div class="handle-bar clearfix">
                                        <div class="btn-group">
                                            <button type="button" ng-click="vm.openCreate('staff')" class="btn btn-default" ng-disabled="!vm.isStaffLoad"><i class="fa fa-plus"></i>新建员工</button>
                                            <button type="button" ng-click="vm.openCreate('user')" class="btn btn-default" ng-disabled="!vm.isStaffLoad"><i class="fa fa-plus"></i>新建用户</button>
                                        </div>
                                        <div class="form-group form-inline pull-right">
                                            <div class="input-group input-select-group">
                                                <span class="pull-left margin-top-5 margin-left-5" ng-if="vm.staffSearching"><i class="fa fa-spin fa-spinner"></i></span>
                                                <select class="form-control" ng-change="vm.changeType('staff')" ng-model="vm.search.staff.k" ng-options="k as v for (k, v) in vm.staffType">
                                                </select>
                                                <input type="text" class="form-control" ng-model="vm.search.staff.q" ng-keyup="vm.makeSearch('staff',$event)" placeholder="{{vm.search.staff.txt}}">
                                                <button class="btn btn-default btn-xl" ng-click="vm.makeSearch('staff')"><i class="fa fa-search"></i>搜索</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="table-wrap margin-top-20">
                                        <table class="table" ng-delegate selector="input[type=checkbox]">
                                            <thead>
                                            <tr>
                                                <th style="width:5%">#</th>
                                                <th style="width:15%">员工编码</th>
                                                <th style="width:20%">员工名称</th>
                                                <th style="width:20%">员工描述</th>
                                                <th style="width:20%">员工状态</th>
                                                <th style="width:20%">操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr class="empty" ng-if="!vm.isStaffLoad">
                                                <td colspan="6">
                                                    <div class="text-center">
                                                        <span>
                                                            <i class="fa fa-spin fa-spinner"></i>
                                                            数据加载中...
                                                        </span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr class="empty" ng-if="!vm.staffList.length && vm.isStaffLoad">
                                                <td colspan="6" class="text-center empty">
                                                    <div class="hint">
                                                        <span><i class="fa fa-exclamation-circle"></i>暂无更多数据</span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr ng-repeat="item in vm.staffList track by $index">
                                                <td><input type="radio" ng-click="vm.toggleCheck('user',item)" name="staff"></td>
                                                <td>{{item.staffCode}}</td>
                                                <td>{{item.staffName}}</td>
                                                <td><span ng-if="item.staffDesc">{{item.staffName}}</span><span ng-if="!item.staffDesc">无</span></td>
                                                <td><span class="label label-danger" ng-if="item.statusCd == 'S0X'">{{vm.status[item.statusCd]}}</span><span class="label label-success" ng-if="item.statusCd == 'S0A'">{{vm.status[item.statusCd]}}</span></td>
                                                <td>
                                                    <div class="btn-action text-center" ng-hide="item.confirm">
                                                        <button type="button" ng-click="vm.openView('staff', item)" class="btn btn-default btn-xs"><i class="fa fa-eye"></i>编辑</button>
                                                        <button type="button" class="btn btn-danger btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-trash"></i>删除</button>
                                                    </div>
                                                    <div class="btn-action" ng-hide="!item.confirm">
                                                        <button class="btn btn-default btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-times"></i>取消</button>
                                                        <button class="btn btn-primary btn-xs" ng-click="vm.del('staff',item.id)"><i class="fa fa-check"></i>确定</button>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="row-pane">
                                        <div class="pagination-group" ng-if="vm.hasPager">
                                            <ui-pagination ng-show="vm.staffList" items-per-page="vm.page.staff.perPage" total-items="vm.page.staff.totalItems" ng-model="vm.page.staff.currentPage" max-size="3" jump-input="true" ng-change="vm.changePage('staff',vm.page.staff.currentPage)"></ui-pagination>
                                        </div>
                                    </div>
                                </ui-tab>
                                <ui-tab tab-id="user" select="vm.load('user')">
                                    <ui-tab-heading>系统用户</ui-tab-heading>
                                    <div class="handle-bar clearfix">
                                        <div class="btn-group">
                                            <!-- <button type="button" ng-click="vm.openCreate('user')" class="btn btn-default" ng-disabled="!vm.isUserLoad"><i class="fa fa-plus"></i>新建用户</button> -->
                                            <button type="button" ng-click="vm.openAppoint('post', 'user')" class="btn btn-default" ng-disabled="!vm.isUserLoad || !vm.userList.length"><i class="fa fa-laptop"></i>指定岗位</button>
                                            <button type="button" ng-click="vm.openAppoint('role', 'user')" class="btn btn-default" ng-disabled="!vm.isUserLoad || !vm.userList.length"><i class="fa fa-flag"></i>指定角色</button>
                                            <button type="button" ng-click="vm.makeAuth('user')" class="btn btn-default" ng-disabled="!vm.isUserLoad || !vm.userList.length"><i class="fa fa-tasks"></i>指定权限</button>
                                        </div>
                                        <div class="form-group form-inline pull-right">
                                            <div class="input-group input-select-group">
                                                <span class="pull-left margin-top-5 margin-left-5" ng-if="vm.userSearching"><i class="fa fa-spin fa-spinner"></i></span>
                                                <input type="text" class="form-control" ng-model="vm.search.user.q" ng-keyup="vm.makeSearch('user',$event)" placeholder="{{vm.search.user.txt}}">
                                                <button class="btn btn-default btn-xl" ng-click="vm.makeSearch('user')"><i class="fa fa-search"></i>搜索</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="table-wrap margin-top-20">
                                        <table class="table">
                                            <thead>
                                            <tr>
                                                <th style="width:5%">#</th>
                                                <th style="width:10%">用户账号</th>
                                                <th style="width:10%">归属系统</th>
                                                <th style="width:10%">员工名称</th>
                                                <th style="width:15%">手机号码</th>
                                                <th style="width:20%">描述</th>
                                                <th style="width:5%">状态</th>
                                                <th style="width:15%">操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr class="empty" ng-if="!vm.isUserLoad">
                                                <td colspan="8">
                                                    <div class="text-center">
                                                        <span>
                                                            <i class="fa fa-spin fa-spinner"></i>
                                                            数据加载中...
                                                        </span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr class="empty" ng-if="!vm.userList.length && vm.isUserLoad">
                                                <td colspan="8" class="text-center empty">
                                                    <div class="hint">
                                                        <span><i class="fa fa-exclamation-circle"></i>暂无更多数据</span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr ng-repeat="item in vm.userList track by $index">
                                                <td><input type="radio" ng-click="vm.toggleCheck('user',item)" name="userRole"></td>
                                                <td>{{item.sysUserCode}}</td>
                                                <td>{{item.platInfo.platName}}</td>
                                                <td>{{item.staff.staffName}}</td>
                                                <td>{{item.staff.mobilePhone}}</td>
                                                <td>{{item.sysUserDesc || '无'}}</td>
                                                <td><span class="label label-warning" ng-if="item.statusCd == 'S0X'">{{vm.status[item.statusCd]}}</span><span class="label label-success">{{vm.status[item.statusCd]}}</span></td>
                                                <td>
                                                    <div class="btn-action text-center" ng-hide="item.confirm">
                                                        <button ng-click="vm.openView('user', item)" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i>编辑</button>
                                                        <button type="button" class="btn btn-danger btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-trash"></i>删除</button>
                                                    </div>
                                                    <div class="btn-action" ng-hide="!item.confirm">
                                                        <button class="btn btn-default btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-times"></i>取消</button>
                                                        <button class="btn btn-primary btn-xs" ng-click="vm.del('user',item.id)"><i class="fa fa-check"></i>确定</button>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="row-pane">
                                        <div class="pagination-group" ng-if="vm.hasPager">
                                            <ui-pagination ng-show="vm.userList" items-per-page="vm.page.user.perPage" total-items="vm.page.user.totalItems" ng-model="vm.page.user.currentPage" max-size="3" jump-input="true" ng-change="vm.changePage('user',vm.page.user.currentPage)"></ui-pagination>
                                        </div>
                                    </div>
                                </ui-tab>
                            </ui-tabset>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</div>